import Vue from 'vue'
import App from './App.vue'
import router from './router'

import vant from 'vant';
Vue.use(vant);
import 'vant/lib/index.css'; // 导入vant css

import "@/mock/index.js" ;//导入模拟接口

Vue.prototype.$fullUrl = (urlPath) => {
    if (!urlPath) return urlPath;
    //如果包含http字符串，直接返回
    if (urlPath.includes("http")) {
        return urlPath;
    }
    //加上BaseAPI生成图片完整Url
    return `${process.env.VUE_APP_BASE_API}${urlPath}`;
}

Vue.prototype.$isMobile = () => {
    return /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent);
}

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')
